#include <iostream>
#include <cstdio>
using namespace std;
int a[5][5]; 
int main(){
	int s1=0,s2=0;
	for(int i=1;i<=4;i++){
		for(int j=1;j<=4;j++){
			cin>>a[i][j];
			if(i==j){
				s1+=a[i][j];
			}else if(i+j==5){
				s2+=a[i][j];
			}
		}
	}
	cout<<s1<<" "<<s2;
	return 0;
}
